home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20000824-20010305
/
000163_news@columbia.edu _Fri Dec 29 14:12:37 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-03-05
|
3KB
Return-Path: <news@columbia.edu>
Received: from watsun.cc.columbia.edu (watsun.cc.columbia.edu [128.59.39.2])
by monire.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id OAA29642
for <kermit.misc@cpunix.cc.columbia.edu>; Fri, 29 Dec 2000 14:12:36 -0500 (EST)
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id OAA02773
for <kermit.misc@watsun.cc.columbia.edu>; Fri, 29 Dec 2000 14:12:36 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id NAA09813
for kermit.misc@watsun.cc.columbia.edu; Fri, 29 Dec 2000 13:44:50 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@columbia.edu (Frank da Cruz)
Subject: Re: Converting struct tm to time_t
Date: 29 Dec 2000 18:44:49 GMT
Organization: Columbia University
Message-ID: <92im31$9ii$1@newsmaster.cc.columbia.edu>
To: kermit.misc@columbia.edu
In article <yllmszt7lk.fsf@windlord.stanford.edu>,
Russ Allbery <rra@stanford.edu> wrote:
: My code doesn't assume it's unsigned; it just won't generate negative
: time_t values. It works fine on systems with a signed time_t (basically
: all of them).
:
OK, great.
: I believe that both of these assumptions are required by POSIX; they're
: certainly true on every UNIX system that I've ever seen.
:
But there are still lots of non-POSIX UNIXes running and I try to support
them.
: > ...but gmtime() and localtime() are not among the most portable
: > of UNIX APIs,
:
: Really? I've never seen a Unix system without them, and was under the
: impression that they were introduced in the early 1980s.
:
I don't mean you can't find them, but that using them in portable code
is often problematic -- which header files to include, where are they,
what are the argument types and where do you pick up their definitions, etc.
: > plus I don't know how consistent their semantics are across platforms,
: > e.g. if you give them a seconds or minutes field greater than 60 or less
: > than 0, etc.
:
: Neither gmtime() nor localtime() take something that has a seconds or
: minutes field, so I assume that you're talking about mktime(). mktime()'s
: normalization of out-of-range values is a requirement of its definition,
: which I believe is in ANSI C.
:
Right, sorry, I meant mktime(). But again, just because some standard
requires certain behavior doesn't make it happen, especially when some of
the mktime() implementations precede the standard.
Anyway, I'll muddle through, thanks again.
- Frank